﻿//  Author:
//       Daniel Großer <olav.daniel.grosser@googlemail.com>
//  
//  Copyright (c) 2012 Copyright (C) 2012 by Daniel Großer. This Code is under GNU LGPL 3.0
// 
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
// 
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;

namespace Beauty.Contract
{
    /// <summary>
    /// This interface should be implemented by any class that wants to act as a
    /// scanner.
    /// </summary>
    public interface IScanner
    {
		/// <summary>
		/// Setup the scanner.
		/// </summary>
		/// <param name='terminals'>
		/// The set of all known terminals.
		/// </param>
		void Setup(ICollection<TerminalAttribute> terminals);
		
        /// <summary>
        /// Get the current line number.
        /// </summary>
        uint Line { get; }
        /// <summary>
        /// Get the current column.
        /// </summary>
        uint Column { get; }
        /// <summary>
        /// Get, whether the end of the input has been reached.
        /// </summary>
        bool EOF { get; }
		
		/// <summary>
		/// Gets the current token.
		/// </summary>
		/// <value>
		/// The current token.
		/// </value>
		string CurrentToken { get; }
		
        /// <summary>
        /// Consume the current token.
        /// </summary>
        /// <returns><see cref="Peek"/></returns>
        MatchResult Consume();		

		/// <summary>
		/// Determines whether this instance can consume any of the specified terminals.
		/// </summary>
		/// <returns>
		/// <c>true</c> if this instance can consume any of the specified terminals; otherwise, <c>false</c>.
		/// </returns>
		/// <param name='terminals'>
		/// The expected terminals.
		/// </param>
        bool CanConsume(IEnumerable<TerminalAttribute> terminals);
    }
}
